package com.tanhua.dubbo.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.model.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserInfoMapper extends BaseMapper<UserInfo> {


    /*
    * 1.查询所有数据
    * 2.修改返回值
    * 3.在方法的第一个参数上：配置分页Page参数对象
    * 4.由于方法参数是多个，在参数前加上@param注解
    * 5.在引导类上配置分页插件
    *
    * */
    @Select("SELECT * FROM tb_user_info WHERE  id IN (SELECT black_user_id FROM tb_black_list WHERE user_id = #{userId})")
    IPage<UserInfo> findBlackList(@Param("page") Page<UserInfo> page,@Param("userId") Long userId);
}
